package cn.edu.scau.cmi.dengzhengyu.comprehensiveExperiment;


import cn.edu.scau.cmi.dengzhengyu.objectAdapter.Person;
import cn.edu.scau.cmi.dengzhengyu.objectAdapter.Student;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;

public class ObjectAdapterUIController {
	@FXML
    private TextArea TextArea;

    @FXML
    private TextField TextField1;

    @FXML
    private Button Btn2;

    @FXML
    private Button Btn1;
    
    public void onBtn1Clicked()
    {
    	if(!TextField1.getText().isEmpty())
    	{
    		Person  p = new Person(TextField1.getText());
    		TextField1.clear();
    		this.TextArea.appendText(p.infomation()+'\n');
    	}
    }
    
    public void onBtn2Clicked()
    {
    	if(!TextField1.getText().isEmpty())
    	{
    		Student  s = new Student(TextField1.getText());
    		TextField1.clear();
    		this.TextArea.appendText(s.study()+'\n');
    	}
    }
}
